<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <link rel="stylesheet" href="../css/zhuce.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <script src="../js/jquery-1.11.3.js"></script>
    <link rel="stylesheet" href="../iconfont/iconfont.css" />
    <title>注册</title>
  </head>
  <body>
    <div class="zhu-com">
      <div class="zhu">
        <a href="../html/shouye.html"><img src="../img/1.png" alt="" /></a>
        <h2>欢迎注册</h2>
      </div>
    </div>
    <div class="login_main">
      <div class="mid">
        <div class="login_form">
          <div class="login_title">
            <a href="#">账户注册</a>
          </div>
          <div class="input_main main_top">
            <div for="" class="login-label">
              <i class="iconfont icon-user"></i>
            </div>
            <input type="text" class="loginname" placeholder="请输入用户名" />
          </div>
          <div class="input_main">
            <div for="" class="login-label">
              <i class="iconfont icon-password"></i>
            </div>
            <input type="password" class="loginpass" placeholder="请输入密码" />
          </div>
          <button class="login_btn">注册</button>
        </div>
      </div>
     
  </body>
  <script>
    $("button").click(function () {
      $.get("http://jx.xuzhixiang.top/ap/api/reg.php", {
        username: $(".loginname").val(),
        password: $(".loginpass").val(),
      }).then((res) => {
        //拿服务器返回的数据
        if (res.code == "1") {
          //是1就 跳转登录页面
          location.href = "denglu.html";
          console.log(res);
        }
      });
    });
  </script>
</html>
